package implementor;

import org.opencv.core.Mat;
import org.opencv.core.Size;
import org.opencv.imgproc.Imgproc;

public class BlurFilter implements Filter {
    private final int kernelSize;
    
    public BlurFilter() {
        this(15);
    }
    
    public BlurFilter(int kernelSize) {
        this.kernelSize = kernelSize;
    }
    
    @Override
    public Mat apply(Mat image) {
        Mat result = new Mat();
        Imgproc.GaussianBlur(image, result, new Size(kernelSize, kernelSize), 0);
        return result;
    }
    
    @Override
    public String getName() {
        return "Blur";
    }
}